
$(function(){  
  var data=function(){
      var str="";
       str+=encodeURI($("[name='fmdata[subject]']").val())+",";
       str+=encodeURI($("[name='fmdata[mj]']").val())+",";
      $("[name='fmdata[shi]'],[name='fmdata[ting]'],[name='fmdata[wei]'],[name='fmdata[chu]'],[name='fmdata[yangtai]']").each(function(){
          str+=$(this).val()+',';
      })
      return str.substring(0,str.length-1)
  }
  var xqdata=function(){
      var str=encodeURI($("[name='fmdata[subject]']").val());
      return str;
  }
  
  $("#addxqt").click(function(){
      send('?action=xqtsadd&data='+xqdata());
  })
   $("#addhxt").click(function(){
    send('?action=hxtsadd&data='+data());
      
   })
    $("[name='bsubmit']").click(function(){
         alert(hx());
         return false;
    })
})
var send=function(_data){
    addpic(_data);
}
function addpic(url){
	floatwin('open_addpic',url);
	CWindow.getWindow(floatwin.fcwid).beforeclose = function(){
		var popener = top.win ?  CWindow.getWindow(top.win)._data.area.CONTENT.dom.childNodes[0].contentWindow : parent;
		var regcode = popener.$('regcode');
		if(regcode!=null)regcode.parentNode.getElementsByTagName('IMG')[0].src +=1;
	};
}